<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
{% load staticfiles %}
<link rel="stylesheet" href="{% static "css/base.css" %}" type="text/css" media="screen" />
<title>Reset Password</title>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<style type="text/css">

.loginboxes{
position: absolute;
margin-top:15em;
margin-left:30em;
font-family: Helvetica;
}

.thetable{
float: left;
margin-left:29em;
margin-right:10em;
margin-top:15em;
margin-bottom: 5em;
height:250px; 
width:500px; 
padding: 7px;
box-shadow:0px 28px 250px 50px black;
font-family: system, sans-serif;
border-top-left-radius: 20px;
border-top-right-radius: 20px;
border-bottom-left-radius: 20px;
border-bottom-right-radius: 20px;
}

</style>

<script language="javascript">
function validate(){
	var uname = document.forms["resetform"]["uname"].value;
	var pwd = document.forms["resetform"]["pwd"].value;
	var newpwd = document.forms["resetform"]["newpwd"].value;
	var newpwd2 = document.forms["resetform"]["newpwd2"].value;
	
	if (uname==null || uname == ""){
		alert("Enter your username.");
		return false;
	}
	
	if (pwd == null || b == ""){
		alert("Please enter your password");	
		return false;
	}

	if (newpwd == null || b == ""){
		alert("Please enter your password");	
		return false;
	}

	if (newpwd2 != newpwd || b == ""){
		alert("Passwords do not match. Enter the password again");	
		return false;
	}
}
</script>
</head>

<body>
	<table class="thetable" >
	<tr><td>
	<div align="center">
	<form name="resetform" action="/blogit/resetpassword/" method="post">{% csrf_token %}
		<table>{{message}}
			<tr>
				<td align="right">Username</td>
				<td align="right"><input type="text" name="uname"></td>
			</tr>
			<tr>
				<td align="right">Old password </td>
				<td align ="right"><input type="password" name="pwd"></td>
			</tr>
			<tr>
				<td align="right">New password </td>
				<td align ="right"><input type="password" name="newpwd"></td>
			</tr>
			<tr>
				<td align="right">Enter new password again</td>
				<td align ="right"><input type="password" name="newpwd2"></td>
			</tr>
		</table><br>
		<table>
			<tr>
				<td align="center"><input type="submit" value="Change Password" onclick="validate()"/><br><br></td>
			</tr>
		</table>
		</div>
	</td></tr></table>
	</form>
	</div>


	</body>
</html>
